home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 8
/
Aminet 8 (1995)(GTI - Schatztruhe)[!][Oct 1995].iso
/
Aminet
/
util
/
cdity
/
Yak210src.lha
/
Yak_2.10_Src
/
GetScreenBox.c
< prev
next >
Wrap
C/C++ Source or Header
|
1995-03-26
|
1KB
|
65 lines
#include <exec/types.h>
#include <intuition/intuition.h>
#include <proto/graphics.h>
#include <graphics/videocontrol.h>
#include "GetScreenBox.h"
void __regargs
GetScreenBox(struct Screen *s,
struct IBox *box,
UWORD bar)
{
struct ViewPortExtra *vpe;
struct TagItem vpe_tags[2];
vpe_tags[0].ti_Data = NULL;
vpe_tags[0].ti_Tag = VTAG_VIEWPORTEXTRA_GET;
vpe_tags[1].ti_Tag = TAG_DONE;
VideoControl(s->ViewPort.ColorMap, vpe_tags);
if (vpe = (struct ViewPortExtra *)vpe_tags[0].ti_Data)
{
/*
* Size of the visible part of the screen
* Is there an easier way to do it ?
*/
box->Left = vpe->DisplayClip.MinX;
box->Top = vpe->DisplayClip.MinY;
box->Width = vpe->DisplayClip.MaxX - box->Left + 1;
box->Height = vpe->DisplayClip.MaxY - box->Top + 1;
if (s->LeftEdge < 0)
box->Left = -s->LeftEdge;
else
box->Left = 0;
if (s->TopEdge < 0)
box->Top = -s->TopEdge;
else
box->Top = 0;
}
else
{
box->Left = 0;
box->Top = 0;
box->Width = s->Width;
box->Height = s->Height;
}
if (bar)
{
if (box->Top <= s->BarHeight)
{
int l = s->BarHeight + 1;
box->Height -= (l - box->Top);
box->Top = l;
}
}
}